package io.polly.ldz.webflux.repository;


import io.polly.ldz.webflux.entity.Question;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * @author ldz112@163.com
 * @description：
 * @date 2025/3/13 10:05
 * Copyright (C) 2023 All Rights Reserved
 */
@Repository
public interface Questionrepository extends ReactiveCrudRepository<Question, Long> {

    //qbc query by criteria
    //qbe query by example

    Flux<Question> findAllByQuestionIdAndBalance(Long questionId, int balance);

    @Query(":questionId $1")
    Flux<Question> findMyQuestion(@Param("questionId") Long questionId);
}
